public class TestString1 {
	public static void main(String[] args) {
		String str="sunjavahpjavaokjavajjavahahajavajavagoodjava";
		String toFind="java";
		int loc=-1,count=0;

		do{
			loc=str.indexOf(toFind, loc+1);
			if(loc!=-1)
			{
				count++;
			}
		}while(loc!=-1);
		
		System.out.println(count);
	}
}